<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 * $Log$
 *
 */
set_time_limit(0);

function SendDBUpdateSQL($strWeb, $strSQL, $strSample){
	$ch = curl_init();
	$arrLink = split('\.', $strWeb);
	if(sizeof($arrLink) == 3){
		curl_setopt($ch, CURLOPT_URL, "http://".$strWeb."/crontab/".$strSample."DBUpdate.php");
	}else{
		curl_setopt($ch, CURLOPT_URL, "http://secure.".$strWeb."/crontab/".$strSample."DBUpdate.php");
	}
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 60);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_POST, 1); 
	curl_setopt($ch, CURLOPT_POSTFIELDS, "CK=2817f503da19fe0159ed581744c3f1fd&strSQL=".$strSQL);
	$ret = curl_exec ($ch);
	curl_close ($ch);
	print "<a style='color: #0000FF; font-size:16px; font-weight: 700;'>".$strWeb.":<a> <br />\n";
	print $ret."<br />\n";
	print "<hr />\n";
}

include($_SERVER["DOCUMENT_ROOT"]."/common/AllWeb.inc.php");

$arrSQL = array();
//$arrSQL[] = "";

//$arrSQL[] = "UPDATE `bet_Member` SET `Password` = 'uuss@taiwan' WHERE `Account` = 'UnionProgramer' LIMIT 1 ;";
$arrSQL[] = "UPDATE `bet_SystemParam` SET `ParamValue` = '99999' WHERE `ParamName` = 'OldPWDExistDays' LIMIT 1 ;";

$strSQL = urlencode(join(" ;;; ", $arrSQL));
foreach($_arrWeb as $key => $arrV){
	SendDBUpdateSQL($arrV[0], $strSQL, "");
}
//樣本DB
SendDBUpdateSQL("luckyball.cc", $strSQL, "Sample_");
?>